using System;
using System.Collections.Generic;
using System.Text;
using SharksHunter.TransferObjects.Presentation;

namespace SharksHunter.UI.Controls.Params
{
    public class NewEntityFileProvider: Abstract.ParamProvider
    {
        public NewEntityFileProvider()
            : base(new string[] { ParamsNames.FileNames }, new System.Windows.Forms.OpenFileDialog())
        {
        }



        override public string[] QueryParam(string param)
        {
            if (param == ParamsNames.FileNames)
                return ((System.Windows.Forms.OpenFileDialog)(this._underlyingCmnDialog)).FileNames;
            throw new SharksHunter.TransferObjects.Exceptions.ParamNotProvidedException(param);
        }

        override public void Initialize()
        {
            ((System.Windows.Forms.OpenFileDialog)(this._underlyingCmnDialog)).Multiselect = true;
            ((System.Windows.Forms.OpenFileDialog)(this._underlyingCmnDialog)).Filter = "CSV files|*.csv";
        }
    }
}
